<?php

use yii\widgets\ActiveForm;
use common\enums\StatusEnum;
use kartik\daterange\DateRangePicker;

$this->title = '编辑';
$this->params['breadcrumbs'][] = ['label' => '订单管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $this->title];
?>
<div class="row">
    <div class="col-lg-12">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">基本信息</h3>
            </div>
            <?php $form = ActiveForm::begin([
                'fieldConfig' => [
                    'template' => "<div class='col-sm-2 text-right'>{label}</div><div class='col-sm-10'>{input}{hint}{error}</div>",
                ]
            ]); ?>
            <div class="box-body">
                <?= $form->field($model,'name')->textInput(['value'=>$data['member_name']]) ?>
                <?= $form->field($model,'phone')->textInput(['value'=>$res['phone']]) ?>
                <?= $form->field($model,'address')->textInput(['value'=>$res['address']]);  ?>
<!--                --><?//= $form->field($model, 'order_name')->textInput() ?>
<!--                --><?//= $form->field($model, 'order_address')->textInput() ?>
                <?= $form->field($model, 'order_visiting_time')->widget(kartik\datetime\DateTimePicker::class, [
                    'language' => 'zh-CN',
                    'options' => [
                        'value' => $model->isNewRecord ? date('Y-m-d H:i:s') : date('Y-m-d H:i:s',$model->order_visiting_time),
                    ],
                    'pluginOptions' => [
                        'format' => 'yyyy-mm-dd hh:ii',
                        'todayHighlight' => true, // 今日高亮
                        'autoclose' => true, // 选择后自动关闭
                        'todayBtn' => true, // 今日按钮显示
                    ]
                ]);?>
                <?= $form->field($model, 'img')->widget('common\widgets\webuploader\Files', [
                    'config' => [ // 配置同图片上传
                        // 'server' => '',
                        'pick' => [
                            'multiple' => true,
                        ],
                        'formData' => [
                            // 不配置则不生成缩略图
                            // 'thumb' => [
                            //     [
                            //         'width' => 100,
                            //         'height' => 100,
                            //     ],
                            // ]
                        ],
                    ]
                ]);?>
                <?= \common\widgets\provinces\Provinces::widget([
                    'form' => $form,
                    'model' => $model,
                    'provincesName' => 'province_id',// 省字段名
                    'cityName' => 'city_id',// 市字段名
                    'areaName' => 'area_id',// 区字段名
                    // 'template' => 'short' //合并为一行显示
                ]); ?>
                <?= $form->field($model, 'order_describe')->widget(\common\widgets\ueditor\UEditor::class) ?>

            </div>
            <!-- /.box-body -->
            <div class="box-footer">
                <div class="col-sm-12 text-center">
                    <button class="btn btn-primary" type="submit">保存</button>
                    <span class="btn btn-white" onclick="history.go(-1)">返回</span>
                </div>
            </div>
            <?php ActiveForm::end(); ?>
        </div>
    </div>
</div>

